package day20171221;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by Adminitrator on 2017/12/21.
 */
public class Text {
    public static void main(String[] args) {

        //正则表达式
        //面向对象程序设计Java2016级信本2班1606101025黄宇作业1
        Matcher matcher= Pattern.compile("Java(\\d+)级信本2班(\\d+)黄宇")
                .matcher("面向对象程序设计Java2016级信本2班1606101025黄宇作业1");
        while (matcher.find()){
            System.out.println(matcher.group(1));
            System.out.println(matcher.group(2));
        }
    }
}
